package com.song.cmsservice.controller;

import com.song.cmsservice.client.IndexFeign;
import com.song.commonutils.ResultObj;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author song
 * @data 2020/4/6
 */
@RestController
@RequestMapping("/cmsservice/teacher")
@Api(description = "前台分页讲师")
public class FrontTeacherController {

    @Autowired
    private IndexFeign indexFeign;

    /**
     * 前台分页讲师
     * @param current
     * @param limit
     * @return
     */
    @ApiOperation(value = "前台分页讲师")
    @GetMapping("/{current}/{limit}")
    public ResultObj list(@PathVariable long current, @PathVariable long limit){
        return indexFeign.list(current,limit);
    }

    /**
     * 讲师详情
     * @param teacherId
     * @return
     */
    @ApiOperation(value = "讲师详情")
    @GetMapping("/getTeacherInfo/{teacherId}")
    public ResultObj getTeacherInfo(@PathVariable String teacherId){
        return indexFeign.getTeacherInfo(teacherId);
    }
}
